<!--
 
  Copyright (c) 2010, Cristian Costantini - cristian@millemultimedia.it
  
  FileManager is licensed under the terms of the Open Source GPL 3.0 license. 
	
	http://www.gnu.org/licenses/gpl.html
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<beans> 

	<!-- set all listeners to event manager -->
	<bean id="EventManager" class="fileManager.event.SystemEventManager">
		<property name="listeners">
			<list>
				
				<map>
					<entry key="name">
						<value>onError</value>
					</entry>
					<entry key="object">
						<ref bean="Logger" />
					</entry>
					<entry key="async">
						<value>false</value>
					</entry>
				</map>
				
				
				<map>
					<entry key="name">
						<value>onPluginLoad</value>
					</entry>
					<entry key="object">
						<ref bean="FacadeGenerator" />
					</entry>
					<entry key="async">
						<value>false</value>
					</entry>
				</map>
				
				<map>
					<entry key="name">
						<value>onPluginLoad</value>
					</entry>
					<entry key="object">
						<ref bean="FileManager" />
					</entry>
					<entry key="async">
						<value>false</value>
					</entry>
				</map>
				
				<map>
					<entry key="name">
						<value>onPluginRegister</value>
					</entry>
					<entry key="object">
						<ref bean="DisplayObject" />
					</entry>
					<entry key="async">
						<value>false</value>
					</entry>
				</map>
				
			</list>
		</property>
	</bean>
	
	<bean id="PlugInLoader" class="fileManager.core.PluginLoader">
		<constructor-arg name="sessionMgr">
			<ref bean="SessionManager" />
		</constructor-arg>
		<constructor-arg name="eventManager">
			<ref bean="EventManager" />
		</constructor-arg>
	</bean>
	
	<bean id="FacadeGenerator" class="fileManager.core.FacadeGenerator">
		<constructor-arg name="codeGenerator">
			<bean class="fileManager.util.codeGenerator.CodeGenerator" />
		</constructor-arg>
	</bean>
	
	<!-- util -->
	<bean id="SessionManager" class="fileManager.util.SessionManager" />
	
	<bean id="DisplayObject" class="fileManager.util.DisplayObject" />
	
	<bean id="Logger" class="fileManager.util.LogManager">
		<constructor-arg name="sessionMgr">
			<ref bean="SessionManager" />
		</constructor-arg>
	</bean>
	
	<!-- delegate -->
	<bean id="FileManager" class="fileManager.core.FileManager">
		<constructor-arg name="sessionMgr">
			<ref bean="SessionManager" />
		</constructor-arg>
		<constructor-arg name="eventManager">
			<ref bean="EventManager" />
		</constructor-arg>
		<constructor-arg name="plugInLoader">
			<ref bean="PlugInLoader" />
		</constructor-arg>
		<constructor-arg name="displayObject">
			<ref bean="DisplayObject" />
		</constructor-arg>
	</bean>

</beans>